package Boke2;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class testThreadPool {
    public static void main(String[] args) {
        //创建线程池
        ExecutorService pool= Executors.newFixedThreadPool(20);
        //王线程池中添加任务
        for (int i = 0; i < 100; i++) {
            pool.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println("hello");
                }
            });
        }

    }
}
